<template>
	<view style="height: 100%;">
	</view>
</template>

<script>
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	export default {
		data() {
			return {
				page:'product',
			}
		},
		computed: {
			...mapGetters(['phoneModelList', 'token'])
		},
		methods: {
			...mapMutations(['setIsStore']),
			toPage() {
				uni.showLoading()
				let timer = setInterval(() => {
					if (this.phoneModelList.length > 0 && this.token) {
						clearInterval(timer)
						uni.hideLoading()
						uni.switchTab({
							url: '/pages/'+this.page
						})
					}
				}, 100)


			}
		},
		onShow() {
			this.toPage()
		},
		onLoad(e) {
			if(e.page){
				this.page = e.page
			}
			console.log('eee', unescape(e.scene).indexOf('ip'));
			const storeIpIndex = unescape(e.scene).indexOf('ip')
			if (storeIpIndex != -1) {
				this.setIsStore(unescape(e.scene).replace('ip=', ''))
			}
		}
	}
</script>

<style>

</style>